import Vue from 'vue'
import Router from 'vue-router'
import TabsView from "@/layouts/tabs/TabsView";
import BlankView from "@/layouts/BlankView";

Vue.use(Router)

export const constRoutes = [
    // {
    //     path: '/login',
    //     name: '登录页',
    //     component: (resolve) => require(['@/pages/login'], resolve),
    // },
    // {
    //     path: '/403',
    //     name: '403',
    //     component: () => (resolve) => require(['@/pages/exception/403'], resolve),
    // },
    // {
    //     path: '*',
    //     name: '404',
    //     component: () => (resolve) => require(['@/pages/exception/404'], resolve),
    // },
    // {
    //     path: '/test1',
    //     name: 'test1',
    //     component: () => import('@/pages/test/test1'),
    //     meta: {
    //         icon: 'dashboard'
    //     },
    // },
    {
        path: '/login',
        name: '登录页',
        component: () => import('@/pages/login')
    },
    {
        path: '/403',
        name: '403',
        component: () => import('@/pages/exception/403'),
    },
    // {
    //     path: '*',
    //     name: '404',
    //     component: () => import('@/pages/exception/404'),
    // },

    {
        path: '/',
        name: '首页',
        component: TabsView,
        children: [
            // {
            //     path: 'dashboard2',
            //     name: 'Dashboard2',
            //     component: () => import('@/pages/test/test1'),
            //     meta: {
            //         icon: 'dashboard'
            //     },
            // },
            {
              path: 'dashboard',
              name: 'Dashboard',
              meta: {
                icon: 'dashboard'
              },
              component: BlankView,
              children: [
                {
                  path: 'workplace',
                  name: '工作台',
                  meta: {
                    page: {
                      closable: false
                    }
                  },
                  component: () => import('@/pages/dashboard/workplace'),
                },
                {
                  path: 'analysis',
                  name: '分析页',
                  component: () => import('@/pages/dashboard/analysis'),
                }
              ]
            }
        ]
    }

]

export default new Router({
    mode: 'hash',
    scrollBehavior: () => ({ y: 0 }),
    routes: constRoutes
})
